3.2.67 \(\int \sec (e+f x) (a+b \sec ^2(e+f x))^2 \, dx\) [167]

3.2.67.1 Optimal result
3.2.67.2 Mathematica [A] (verified)
3.2.67.3 Rubi [A] (verified)
3.2.67.4 Maple [A] (verified)
3.2.67.5 Fricas [A] (verification not implemented)
3.2.67.6 Sympy [F]
3.2.67.7 Maxima [A] (verification not implemented)
3.2.67.8 Giac [A] (verification not implemented)
3.2.67.9 Mupad [B] (verification not implemented)

3.2.67.1 Optimal result

Integrand size = 21, antiderivative size = 91 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\left (8 a^2+8 a b+3 b^2\right ) \text {arctanh}(\sin (e+f x))}{8 f}+\frac {3 b (2 a+b) \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b \sec ^3(e+f x) \left (a+b-a \sin ^2(e+f x)\right ) \tan (e+f x)}{4 f} \]

output
1/8*(8*a^2+8*a*b+3*b^2)*arctanh(sin(f*x+e))/f+3/8*b*(2*a+b)*sec(f*x+e)*tan 
(f*x+e)/f+1/4*b*sec(f*x+e)^3*(a+b-a*sin(f*x+e)^2)*tan(f*x+e)/f
 
3.2.67.2 Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.20 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {a^2 \text {arctanh}(\sin (e+f x))}{f}+\frac {a b \text {arctanh}(\sin (e+f x))}{f}+\frac {3 b^2 \text {arctanh}(\sin (e+f x))}{8 f}+\frac {a b \sec (e+f x) \tan (e+f x)}{f}+\frac {3 b^2 \sec (e+f x) \tan (e+f x)}{8 f}+\frac {b^2 \sec ^3(e+f x) \tan (e+f x)}{4 f} \]

input
Integrate[Sec[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]
 
output
(a^2*ArcTanh[Sin[e + f*x]])/f + (a*b*ArcTanh[Sin[e + f*x]])/f + (3*b^2*Arc 
Tanh[Sin[e + f*x]])/(8*f) + (a*b*Sec[e + f*x]*Tan[e + f*x])/f + (3*b^2*Sec 
[e + f*x]*Tan[e + f*x])/(8*f) + (b^2*Sec[e + f*x]^3*Tan[e + f*x])/(4*f)
 
3.2.67.3 Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.15, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4635, 315, 25, 298, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sec (e+f x) \left (a+b \sec (e+f x)^2\right )^2dx\)

\(\Big \downarrow \) 4635

\(\displaystyle \frac {\int \frac {\left (-a \sin ^2(e+f x)+a+b\right )^2}{\left (1-\sin ^2(e+f x)\right )^3}d\sin (e+f x)}{f}\)

\(\Big \downarrow \) 315

\(\displaystyle \frac {\frac {b \sin (e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 \left (1-\sin ^2(e+f x)\right )^2}-\frac {1}{4} \int -\frac {(a+b) (4 a+3 b)-a (4 a+b) \sin ^2(e+f x)}{\left (1-\sin ^2(e+f x)\right )^2}d\sin (e+f x)}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {1}{4} \int \frac {(a+b) (4 a+3 b)-a (4 a+b) \sin ^2(e+f x)}{\left (1-\sin ^2(e+f x)\right )^2}d\sin (e+f x)+\frac {b \sin (e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 \left (1-\sin ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 298

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (8 a^2+8 a b+3 b^2\right ) \int \frac {1}{1-\sin ^2(e+f x)}d\sin (e+f x)+\frac {3 b (2 a+b) \sin (e+f x)}{2 \left (1-\sin ^2(e+f x)\right )}\right )+\frac {b \sin (e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 \left (1-\sin ^2(e+f x)\right )^2}}{f}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {\frac {1}{4} \left (\frac {1}{2} \left (8 a^2+8 a b+3 b^2\right ) \text {arctanh}(\sin (e+f x))+\frac {3 b (2 a+b) \sin (e+f x)}{2 \left (1-\sin ^2(e+f x)\right )}\right )+\frac {b \sin (e+f x) \left (-a \sin ^2(e+f x)+a+b\right )}{4 \left (1-\sin ^2(e+f x)\right )^2}}{f}\)

input
Int[Sec[e + f*x]*(a + b*Sec[e + f*x]^2)^2,x]
 
output
((b*Sin[e + f*x]*(a + b - a*Sin[e + f*x]^2))/(4*(1 - Sin[e + f*x]^2)^2) + 
(((8*a^2 + 8*a*b + 3*b^2)*ArcTanh[Sin[e + f*x]])/2 + (3*b*(2*a + b)*Sin[e 
+ f*x])/(2*(1 - Sin[e + f*x]^2)))/4)/f
 

3.2.67.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 298
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-( 
b*c - a*d))*x*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] - Simp[(a*d - b*c*( 
2*p + 3))/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, 
 c, d, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/2 + p, 0])
 

rule 315
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[(a*d - c*b)*x*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 1)/(2*a*b*(p + 1))), 
x] - Simp[1/(2*a*b*(p + 1))   Int[(a + b*x^2)^(p + 1)*(c + d*x^2)^(q - 2)*S 
imp[c*(a*d - c*b*(2*p + 3)) + d*(a*d*(2*(q - 1) + 1) - b*c*(2*(p + q) + 1)) 
*x^2, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, - 
1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, 2, p, q, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4635
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_ 
))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f 
 Subst[Int[ExpandToSum[b + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 - ff^2*x^2)^((m 
+ n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && In 
tegerQ[(m - 1)/2] && IntegerQ[n/2] && IntegerQ[p]
 
3.2.67.4 Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.18

method result size
derivativedivides \(\frac {a^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+2 a b \left (\frac {\tan \left (f x +e \right ) \sec \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+b^{2} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}\) \(107\)
default \(\frac {a^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+2 a b \left (\frac {\tan \left (f x +e \right ) \sec \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+b^{2} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}\) \(107\)
parts \(\frac {a^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {b^{2} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}+\frac {a b \tan \left (f x +e \right ) \sec \left (f x +e \right )}{f}+\frac {a b \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\) \(112\)
parallelrisch \(\frac {-4 \left (a^{2}+a b +\frac {3}{8} b^{2}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 f x +4 e \right )}{4}+\cos \left (2 f x +2 e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+4 \left (a^{2}+a b +\frac {3}{8} b^{2}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 f x +4 e \right )}{4}+\cos \left (2 f x +2 e \right )\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+2 b \left (\left (a +\frac {3 b}{8}\right ) \sin \left (3 f x +3 e \right )+\sin \left (f x +e \right ) \left (a +\frac {11 b}{8}\right )\right )}{f \left (\cos \left (4 f x +4 e \right )+4 \cos \left (2 f x +2 e \right )+3\right )}\) \(157\)
norman \(\frac {-\frac {b \left (8 a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}-\frac {b \left (8 a -3 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}+\frac {b \left (8 a +5 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {b \left (8 a +5 b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{4}}-\frac {\left (8 a^{2}+8 a b +3 b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{8 f}+\frac {\left (8 a^{2}+8 a b +3 b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{8 f}\) \(177\)
risch \(-\frac {i b \,{\mathrm e}^{i \left (f x +e \right )} \left (8 a \,{\mathrm e}^{6 i \left (f x +e \right )}+3 b \,{\mathrm e}^{6 i \left (f x +e \right )}+8 a \,{\mathrm e}^{4 i \left (f x +e \right )}+11 b \,{\mathrm e}^{4 i \left (f x +e \right )}-8 a \,{\mathrm e}^{2 i \left (f x +e \right )}-11 b \,{\mathrm e}^{2 i \left (f x +e \right )}-8 a -3 b \right )}{4 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) a^{2}}{f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) a b}{f}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) b^{2}}{8 f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) a^{2}}{f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) a b}{f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) b^{2}}{8 f}\) \(246\)

input
int(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 
output
1/f*(a^2*ln(sec(f*x+e)+tan(f*x+e))+2*a*b*(1/2*tan(f*x+e)*sec(f*x+e)+1/2*ln 
(sec(f*x+e)+tan(f*x+e)))+b^2*(-(-1/4*sec(f*x+e)^3-3/8*sec(f*x+e))*tan(f*x+ 
e)+3/8*ln(sec(f*x+e)+tan(f*x+e))))
 
3.2.67.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.27 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{4} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left ({\left (8 \, a b + 3 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, b^{2}\right )} \sin \left (f x + e\right )}{16 \, f \cos \left (f x + e\right )^{4}} \]

input
integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")
 
output
1/16*((8*a^2 + 8*a*b + 3*b^2)*cos(f*x + e)^4*log(sin(f*x + e) + 1) - (8*a^ 
2 + 8*a*b + 3*b^2)*cos(f*x + e)^4*log(-sin(f*x + e) + 1) + 2*((8*a*b + 3*b 
^2)*cos(f*x + e)^2 + 2*b^2)*sin(f*x + e))/(f*cos(f*x + e)^4)
 
3.2.67.6 Sympy [F]

\[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \sec {\left (e + f x \right )}\, dx \]

input
integrate(sec(f*x+e)*(a+b*sec(f*x+e)**2)**2,x)
 
output
Integral((a + b*sec(e + f*x)**2)**2*sec(e + f*x), x)
 
3.2.67.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.31 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left ({\left (8 \, a b + 3 \, b^{2}\right )} \sin \left (f x + e\right )^{3} - {\left (8 \, a b + 5 \, b^{2}\right )} \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1}}{16 \, f} \]

input
integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")
 
output
1/16*((8*a^2 + 8*a*b + 3*b^2)*log(sin(f*x + e) + 1) - (8*a^2 + 8*a*b + 3*b 
^2)*log(sin(f*x + e) - 1) - 2*((8*a*b + 3*b^2)*sin(f*x + e)^3 - (8*a*b + 5 
*b^2)*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1))/f
 
3.2.67.8 Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.32 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \sin \left (f x + e\right ) + 1 \right |}\right ) - {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \sin \left (f x + e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (8 \, a b \sin \left (f x + e\right )^{3} + 3 \, b^{2} \sin \left (f x + e\right )^{3} - 8 \, a b \sin \left (f x + e\right ) - 5 \, b^{2} \sin \left (f x + e\right )\right )}}{{\left (\sin \left (f x + e\right )^{2} - 1\right )}^{2}}}{16 \, f} \]

input
integrate(sec(f*x+e)*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")
 
output
1/16*((8*a^2 + 8*a*b + 3*b^2)*log(abs(sin(f*x + e) + 1)) - (8*a^2 + 8*a*b 
+ 3*b^2)*log(abs(sin(f*x + e) - 1)) - 2*(8*a*b*sin(f*x + e)^3 + 3*b^2*sin( 
f*x + e)^3 - 8*a*b*sin(f*x + e) - 5*b^2*sin(f*x + e))/(sin(f*x + e)^2 - 1) 
^2)/f
 
3.2.67.9 Mupad [B] (verification not implemented)

Time = 18.69 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.95 \[ \int \sec (e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\mathrm {atanh}\left (\sin \left (e+f\,x\right )\right )\,\left (a^2+a\,b+\frac {3\,b^2}{8}\right )}{f}+\frac {\sin \left (e+f\,x\right )\,\left (\frac {5\,b^2}{8}+a\,b\right )-{\sin \left (e+f\,x\right )}^3\,\left (\frac {3\,b^2}{8}+a\,b\right )}{f\,\left ({\sin \left (e+f\,x\right )}^4-2\,{\sin \left (e+f\,x\right )}^2+1\right )} \]

input
int((a + b/cos(e + f*x)^2)^2/cos(e + f*x),x)
 
output
(atanh(sin(e + f*x))*(a*b + a^2 + (3*b^2)/8))/f + (sin(e + f*x)*(a*b + (5* 
b^2)/8) - sin(e + f*x)^3*(a*b + (3*b^2)/8))/(f*(sin(e + f*x)^4 - 2*sin(e + 
 f*x)^2 + 1))